package com.huatech.core.support.session;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import javax.websocket.Session;

import com.alibaba.fastjson.JSONObject;
/**
 * 
 * @author lihua_java@163.com
 *
 */
public class SimpleSession implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Session session;
	private Map<String, String> params = new HashMap<>();
	public SimpleSession() {
	}
	public SimpleSession(Session session) {
		super();
		this.session = session;
	}
	public boolean createConn(String message){
		JSONObject json = JSONObject.parseObject(message);
		String url = json.getString("url");
		if(url == null || url.equals("")){
			return false;
		}
		params.put(url, message);
		return true;
	}
	public Session getSession() {
		return session;
	}
	public void setSession(Session session) {
		this.session = session;
	}
	public Map<String, String> getParams() {
		return params;
	}
	public void setParams(Map<String, String> params) {
		this.params = params;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
}
